package com.party.core.dao.read.wechatPlatform;

import com.party.core.dao.read.BaseReadDao;
import com.party.core.model.wechatPlatform.WechatOpenMember;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: Administrator.
 * @Description: 微信授权管理授权者信息
 * @Date:Created in 2017/8/26 0026 上午 9:39.
 */
@Repository
public interface WechatOpenMemberReadDao extends BaseReadDao<WechatOpenMember> {

    WechatOpenMember findByMemberId(@Param(value = "memberId") String memberId);

    /**
     * 获取系统配置信息
     *
     * @return 授权者信息
     */
    WechatOpenMember getSystem();

    WechatOpenMember getByMemberIdAndDeployType(@Param(value = "memberId") String memberId,
                                                @Param(value = "deployType") Integer deployType);

    /**
     * 根据appid 和填写类型查询
     *
     * @param appid appid
     * @param deployType 填写配置
     * @return 微信账号
     */
    WechatOpenMember findByAppidAndDeployType(@Param(value = "appid") String appid,
                                              @Param(value = "deployType") Integer deployType);

    List<WechatOpenMember> listNoRelation(@Param("deployType") Integer deployType,
                                          @Param(value = "memberId") String memberId);

    WechatOpenMember findByType(@Param(value = "type") String type);
}
